<{include file="public/header.html"}>
	<div class="xinsu-right">
		<div class="xinsu-right-content">
			<div class="xinsu-data-content">
				<div class="xinsu-title">
					<span class="layui-breadcrumb">
						<a><cite>当前位置</cite></a>
						<a><cite>除权除息</cite></a>
					</span>
				</div>
				<form class="layui-form xinsu-form" action="" method="get">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label xinsu-form-label">停牌</label>
							<div class="layui-input-inline xinsu-input-inline">
								<select name="stop">
									<option value="3" <{if $stop=='3'}>selected="selected"<{/if}>>全部</option>
									<option value="1" <{if $stop=='1'}>selected="selected"<{/if}>>停牌</option>
									<option value="0" <{if $stop=='0'}>selected="selected"<{/if}>>无停</option>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label xinsu-form-label">买卖</label>
							<div class="layui-input-inline xinsu-input-inline">
								<select name="bull_sell">
									<option value="0" <{if $bull_sell=='0'}>selected="selected"<{/if}>>全部</option>
									<option value="1" <{if $bull_sell=='1'}>selected="selected"<{/if}>>可买</option>
									<option value="2" <{if $bull_sell=='2'}>selected="selected"<{/if}>>可卖</option>
									<option value="3" <{if $bull_sell=='3'}>selected="selected"<{/if}>>禁买</option>
									<option value="4" <{if $bull_sell=='4'}>selected="selected"<{/if}>>禁卖</option>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label xinsu-form-label">升跌</label>
							<div class="layui-input-inline xinsu-input-inline">
								<select name="bull_sell_type">
									<option value="0" <{if $bull_sell_type=='0'}>selected="selected"<{/if}>>全部</option>
									<option value="1" <{if $bull_sell_type=='1'}>selected="selected"<{/if}>>可买升</option>
									<option value="2" <{if $bull_sell_type=='2'}>selected="selected"<{/if}>>禁买升</option>
									<option value="3" <{if $bull_sell_type=='3'}>selected="selected"<{/if}>>可买跌</option>
									<option value="4" <{if $bull_sell_type=='4'}>selected="selected"<{/if}>>禁买跌</option>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label xinsu-form-label">代码</label>
							<div class="layui-input-inline xinsu-input-inline">
								<input type="text" name="code" class="layui-input" value="<{if $code != '0'}><{urldecode($code)}><{/if}>" width="10"/>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label xinsu-form-label">名称</label>
							<div class="layui-input-inline xinsu-input-inline">
								<input type="text" name="name" class="layui-input" value="<{if $name != '0'}><{urldecode($name)}><{/if}>" width="10" />
							</div>
						</div>

						<button class="layui-btn xinsu-btn">查询</button>
						<span>记录总数：共 <{$total}> 条</span>
					</div>
				</form>
				<div class="layui-form xinsu-form">
					<table class="layui-table">
						<thead>
							<tr>
								<th>ID</th>
								<th>代码</th>
								<th>名称</th>
								<th>拼音</th>
								<th>类型</th>
								<th>板块</th>
								<th>最小成交额</th>
								<th>操作</th>
							</tr> 
						</thead>
						<tbody>
							<{if empty($list) == false}>
							<{foreach $list as $val}>
							<tr>
								<td><{$val.id}></td>
								<td><{$val.code}></td>
								<td><{$val.name}></td>
								<td><{$val.pinyin}></td>
								<td><{if $val.type == 'sz' }>深证<{else}>上证<{/if}></td>
								<td><{trim($val.bk_list, ',')}></td>
								<td><{$val.min_num}></td>
								<td>
									<a id="xinsu-can_bull-<{$val.id}>" class="<{if $val.can_bull == 1}>xinsu-fontcolor-blue<{else}>xinsu-fontcolor-red<{/if}> xinsu-change_stock" href="javascript:;" data="<{$val.id}>"  data-uri="/<{$common_info.controller}>/change/can_bull/<{$val.id}>"><{if $val.can_bull == 1}>可买<{else}>禁买<{/if}></a>
									<a id="xinsu-can_sell-<{$val.id}>" class="<{if $val.can_sell == 1}>xinsu-fontcolor-blue<{else}>xinsu-fontcolor-red<{/if}> xinsu-change_stock" href="javascript:;" data="<{$val.id}>"  data-uri="/<{$common_info.controller}>/change/can_sell/<{$val.id}>"><{if $val.can_sell == 1}>可卖<{else}>禁卖<{/if}></a>
									<a id="xinsu-can_bull_up-<{$val.id}>" class="<{if $val.can_bull_up == 1}>xinsu-fontcolor-blue<{else}>xinsu-fontcolor-red<{/if}> xinsu-change_stock" href="javascript:;" data="<{$val.id}>"  data-uri="/<{$common_info.controller}>/change/can_bull_up/<{$val.id}>"><{if $val.can_bull_up == 1}>可买升<{else}>禁买升<{/if}></a>
									<a id="xinsu-can_bull_down-<{$val.id}>" class="<{if $val.can_bull_down == 1}>xinsu-fontcolor-blue<{else}>xinsu-fontcolor-red<{/if}> xinsu-change_stock" href="javascript:;" data="<{$val.id}>"  data-uri="/<{$common_info.controller}>/change/can_bull_down/<{$val.id}>"><{if $val.can_bull_down == 1}>可买跌<{else}>禁买跌<{/if}></a>
									<a class="<{if $val.stop_pai == 0}>xinsu-fontcolor-blue<{else}>xinsu-fontcolor-red<{/if}>" href="javascript:;"><{if $val.stop_pai == 1}>停牌<{else}>无停<{/if}></a>
									<a class="<{if $val.open == 1}>xinsu-fontcolor-blue<{else}>xinsu-fontcolor-red<{/if}>" href="javascript:;"><{if $val.open == 1}>开盘<{else}>关盘<{/if}></a>
									<a class="xinsu-fontcolor-blue xinsu-amend xinsu-edit" href="javascript:;" data="<{$val.id}>">修改</a>
									<a class="xinsu-fontcolor-blue xinsu-delete" href="javascript:;" data="<{$val.id}>">删除</a>
								</td>
								
							</tr>
							<{/foreach}>
							<{else}>
							<tr>
								<td colspan="8">暂无数据</td>
							</tr>
							<{/if}>
						</tbody>
					</table>
				</div>
				<div class="xinsu-page">
					<div class="xinsu-show">
						<{$page}>
					</div>
					<div class="xinsu-clear"></div>
				</div>
			</div>
		</div>
	</div>
	<script>
		$(".xinsu-change_stock").click(function(){
			var url = $(this).attr("data-uri");
			http_request_post(url, {}, form_charge_stock_callback);
		})
		function form_charge_stock_callback(result) {
			if (result.status == 1) {
				layer.msg(result.msg, {icon: 1, time: 800}, function() {
						var res = eval(result.data);
						var id = res["id"];
						var value = res["value"];
						var field = res["field"];
						var is_field = res[field];
						var msg=""
						if(field=="can_bull"){
							value==1 ? msg = "可买" : msg = "禁买";
						}
						else if(field=="can_sell"){
							value==1 ? msg = "可卖" : msg = "禁卖";
						}
						else if(field=="can_bull_up"){
							value==1 ? msg = "可买升" : msg = "禁买升";
						}
						else if(field=="can_bull_down"){
							value==1 ? msg = "可买跌" : msg = "禁买跌";
						}else if(field=="open"){
							value==1 ? msg = "开盘" : msg = "关盘";
						}
						else if(field=="stop_pai"){
							value==1 ? msg = "停牌" : msg = "无停";
						}
						
						$("#xinsu-"+field+"-" + id).html(msg);
						if (value == 0) {
							if(field == "stop_pai"){
								$("#xinsu-"+field+"-" + id).removeClass("xinsu-fontcolor-red");
								$("#xinsu-"+field+"-" + id).addClass("xinsu-fontcolor-blue");
							}
							else{
								$("#xinsu-"+field+"-" + id).removeClass("xinsu-fontcolor-blue");
								$("#xinsu-"+field+"-" + id).addClass("xinsu-fontcolor-red");
							}
							
						} else {
							if(field == "stop_pai"){
								$("#xinsu-"+field+"-" + id).removeClass("xinsu-fontcolor-blue");
								$("#xinsu-"+field+"-" + id).addClass("xinsu-fontcolor-red");
							}
							else{
								$("#xinsu-"+field+"-" + id).removeClass("xinsu-fontcolor-red");
								$("#xinsu-"+field+"-" + id).addClass("xinsu-fontcolor-blue");
							}
						}
					});
			} else {
				layer.msg(result.msg);
			}
		}
	</script>
<{include file="public/footer.html"}>